<template>
	<div class="noticeContent">
		
		<!--头部-->
		<!-- <my-header :title="'商城快讯'" :hasTitle="true" :hasBack="true" ></my-header> -->
		<!--<div style="height:3rem;"></div>-->
		<div class="centent" style="width: 100%;flex:1;overflow-y:auto;">
				<!--消息数据是空的-->
		    	<!--消息列表-->
			<ul class="message_list" v-if="myData && myData.length" style="text-align: left;">
					<!-- v-show="item.status !== 1 && item.status !== 3" -->
				<div v-for="(item, index) in myData" :key="index">
	
					<!--<li style="text-align: left;">-->
						<h2 class="title">{{item.title}}</h2>
						<div class="release_time" style="text-align: left;"><span>{{item.createTm | startTime}}</span></div>
						<!-- <p v-html="item.content" class="contentZx">{{item.content}}</p>  -->
                        <div v-html="item.content"></div>
					<!--</li>-->
				</div>
			</ul>
			<div class="no_data" style="margin-top:3rem;" v-else>
			    <img src="static/image/no_order.png"/>
			    <p>暂无快讯~</p>
			    <!-- <div class="back_home aui-btn aui-btn-outlined" @click.stop="goHome">逛逛首页</div> -->
			</div>
		</div>
	</div>
</template>
<script>
    import { mapGetters } from "vuex";
    import { MessageBox } from '../../ui-components';
    export default {
     	// props: ['myData'],
        components:{

        },
        data () {
            return {
                flag:false,
                myData:[]
            }
        },
        computed: {
			...mapGetters('zx',[
                "getNoticeDetailDate",
			]),
		},
        filters: {
			startTime: function(time) {
				let date = new Date(time);
				// return date.getFullYear() + "-" + date.getMonth() + "-";
				return `${date.getFullYear()}-${date.getMonth()+ 1}-${date.getDate()}  ${date.getHours() > 9 ? date.getHours() : '0' + date.getHours()}:${date.getMinutes() > 9 ? date.getMinutes() : '0' + date.getMinutes()}`;
			}
        },
        methods:{
            //判断对象是否为空的方法 为空返回true,否则返回false
            checkObj(obj) {
                for(var key in obj) {
                    return false;
                }
                return true;
            }
        },
        created(){
            console.log(this.getNoticeDetailDate,'公告详情数据');
            let arr = [];
            if(!this.checkObj(this.getNoticeDetailDate)){
                arr.push(this.getNoticeDetailDate);
            }
            this.myData = arr;
            // MessageBox.prompt('未登录', {
            //     title: "未登录",
            //     message: '请先登录再进行结算',
            //     confirmButtonText: '去登录'
            // }).then(()=>{
            //         console.log('thenthenthenthen')
            // })
        },  
        watch:{
        	myData(newVal,oldVal){
        		console.log(newVal,oldVal,'newold');
        	}
        }
    }
</script>
<style scoped="scoped">
    .noticeContent {
	    width: 100%;
	    height: 100%;
	    display: flex;
	    flex-direction: column;
	    justify-content: space-between;
	}
  
    .message_list li p {
	    line-height: 1.6rem;
	    position: relative;
	     white-space:normal; 
	     overflow: inherit; 
	     text-overflow: inherit; 
	    padding-right: 0.75rem;
	    width: 100%;
	}
	.title{
		margin-top: 1rem;
	}
	.contentZx img {
    	max-width: 100%;
	}
</style>